import axios from './axios'

export const getTopics=()=>axios.get('/topics')

export const getTopic=(id)=>axios.get('/topic/'+id)

export const createTopic=(data)=>axios.post('/topics',data)

export const getCollect=(loginname)=>axios.get('/topic_collect/'+loginname)
//收藏主题
export const collectTopic=(data)=>{
   return axios.post('/topic_collect/collect',data) 
}
//取消收藏
export const delCollection=(data)=>{
    return axios.post('/topic_collect/de_collect',data)
}
//用户详情
export const getUser=(loginname)=>axios.get('/user/'+loginname) 
//验证token
export const userToken=(data)=>axios.post('/accesstoken',data)
